<template>
  <div class="sale-detail">
    <el-form style="margin-top: 30px; width: 600px;" ref="productSaleForm" :model="value" label-width="150px" label-suffix=":">
      <el-form-item label="赠送积分">
        <el-input v-model="value.giftScore"></el-input>
      </el-form-item>
      <el-form-item label="赠送成长值">
        <el-input v-model="value.giftGrow"></el-input>
      </el-form-item>
      <el-form-item label="商品上架">
        <el-switch v-model="value.publishStatus" :active-value="1" :inactive-value="0" />
      </el-form-item>
      <el-form-item label="商品推荐">
        <span style="margin-right: 10px;">新品</span>
        <el-switch v-model="value.newsStatus" :active-value="1" :inactive-value="0" />
        <span style="margin: 0 10px;">推荐</span>
        <el-switch v-model="value.recommendStatus" :active-value="1" :inactive-value="0" />
      </el-form-item>
      <el-form-item label="服务保证">
        <el-checkbox-group v-model="selectServiceList">
          <el-checkbox :label="1" name="type">1小时达</el-checkbox>
          <el-checkbox :label="2" name="type">满60免运费</el-checkbox>
          <el-checkbox :label="3" name="type">无忧退款</el-checkbox>
        </el-checkbox-group>
      </el-form-item>
      <el-form-item label="净含量">
        <el-input v-model="value.netContent"></el-input>
      </el-form-item>
      <el-form-item label="保存条件">
        <el-input v-model="value.storageCondition"></el-input>
      </el-form-item>
      <el-form-item label="保质期">
        <el-input v-model="value.quality"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button size="medium" @click="handlePrev()">上一步, 填写商品信息</el-button>
        <el-button type="primary" size="medium" @click="handleNext()">下一步, 填写商品属性</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { ref } from 'vue'
export default {
  name: "ProductSaleDetail",
  emits: ['prevStep', 'nextStep'],
  props: {
    value: Object,
  },
  setup(props, context) {
    const productSaleForm = ref(null);
    let selectServiceList = ref([]);
    // 上一步
    const handlePrev = () => {
      context.emit('prevStep')
    };
    // 下一步
    const handleNext = () => {
      context.emit('nextStep')
    };
    return {
      handlePrev,
      handleNext,
      productSaleForm,
      selectServiceList
    };
  }
}
</script>

<style scoped lang="less">
</style>